import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false
function isWeiXin () {
  let ua = window.navigator.userAgent.toLowerCase()
  if (ua.match(/MicroMessenger/i) != 'micromessenger') {
    return false
  }
  let toURL = null
  router.beforeEach((to, from, next) => {
    if (toURL === to.path) {
      next()
    }
    if (to.path !== from.path) {
      toURL = to.path
      router.replace(to.path)
      next()
    }
  })
}
isWeiXin()
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
